import { post, get } from "../axiosDriver"
import {setToFormData} from '@/utils/common'

export default new  class Renbao{
  // 提交订单
  createOrder(data) {
    let params = setToFormData(data) || {}
    const url = "/renbao/tb/createInsure"
    return post(url, params)
  }
  // 注册 /staff/register
  register(data) {
    let params = setToFormData(data) || {}
    const url = "/renbao/staff/register"
    return post(url, params)
  }
  // 登录 /staff/login
  login(data) {
    let params = setToFormData(data) || {}
    const url = "/renbao/staff/login"
    return post(url, params)
  }
  // 验证码 /staff/sendCode
  getVertifyCode(data) {
    let params = data || {}
    const url = "/renbao/staff/sendCode"
    return get(url, params)
  }
  // 注销 /staff/logout
  loginOut(data) {
    let params = setToFormData(data) || {}
    const url = "/renbao/staff/logout"
    return post(url, params)
  }

  memberLink(data) {
    let params = setToFormData(data) || {}
    let url = '/renbao/staff/relate'
    return post(url, params)
  }

  // 后台配置的列表
  insuranceList(data){
    let params = data || {}
    const url = "/renbao/staff/insurance_list"
    return get(url, params)
  }
  // 获取保险列表
  getWorkersInsuranceList(data) {
    let params = data || {}
    const url = "/renbao/staff/statistic"
    return get(url, params)
  }

  insuranceDetail(data) {
    const url = "/renbao/staff/insurance_detail"
    let params = setToFormData(data) || {}
    return post(url, params)
  }

  getWxRelateInfo(data) {
    const url = "/renbao/staff/relateWxInfo"
    let params = setToFormData(data) || {}
    return post(url, params)
  }
  // 级别获取 一级 二级 游客
  isVistor(data) {
    const url = "/renbao/staff/distinctUser"
    return get(url, data)
  }
  //
  isTxForm (data){
    const url = "/renbao/staff/isTxForm"
    return get(url, data)
  }

  sumbitSecondInfo(data) {
    let url = "/renbao/staff/tgForm"
    let params = setToFormData(data) || {}
    return post(url, params)
  }
  // 二级的业绩
  secondInsuranceAccount(data) {
    let url = "/renbao/staff/StatisticSecond"
    return get(url, data)
  }
}()
